package com.amap.search.entity.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;
import java.util.List;

@Data
@ApiModel("高德地图天气信息返回")
public class AmapWeatherResponse extends AmapBaseResponse{
    @ApiModelProperty("实时天气数据")
    private List<Lives> lives;

    @ApiModelProperty("预报天气信息")
    Forecast forecast;

    @Data
    public static class Lives{
        private String province;

        private String city;

        @ApiModelProperty("区域编码")
        private String adcode;

        @ApiModelProperty("天气现象（汉字描述）")
        private String weather;

        @ApiModelProperty("实时气温，单位：摄氏度")
        private Double temperature;

        @ApiModelProperty("风向描述")
        private String winddirection;

        @ApiModelProperty("风力级别，单位：级")
        private String windpower;

        @ApiModelProperty("空气湿度")
        private String humidity;

        @ApiModelProperty("数据发布时间")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private Date reporttime;
    }

    @Data
    public static class Forecast{
        private String city;

        private String adcode;

        private String province;

        private String reporttime;

        private List<Cast> casts;
    }

    public static class Cast{
        @ApiModelProperty("预计日期")
        private String date;

        @ApiModelProperty("星期几")
        private String week;

        @ApiModelProperty("白天天气现象")
        private String dayweather;

        @ApiModelProperty("晚上天气现象")
        private String nightweather;

        @ApiModelProperty("白天温度")
        private Double daytemp;

        @ApiModelProperty("晚上温度")
        private Double nighttemp;

        @ApiModelProperty("白天风向")
        private String daywind;

        @ApiModelProperty("晚上风向")
        private String nightwind;

        @ApiModelProperty("白天风力")
        private String daypower;

        @ApiModelProperty("晚上风力")
        private String nightpower;

    }
}
